package com.biscuit.page.basicservice.model.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author mazihao
 * @createTime 2024/3/23 9:45
 */
@Getter
public enum LoginTypeEnum {

    PASSWORD_LOGIN(1, "密码登录"),
    VERIFY_CODE_LOGIN(2, "验证码登录"),
    REGISTER_LOGIN(3, "注册登录");

    private final int type;
    private final String desc;

    LoginTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static LoginTypeEnum getTypeEnumByType(Integer type) {
        return Arrays.stream(LoginTypeEnum.values()).filter(x -> x.getType() == type).findFirst().orElse(null);
    }

}
